#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <conio.h>


void inputString(const char * prompt, char * input)
{
        input[0] = 0;
        printf("%s", prompt);
        scanf("%[^\n]", input);
        fflush(stdin);
}


void* BinarySearch(void* key, void* base, size_t nmemb, size_t size, int (*compare)(void* , void*))
{
        size_t  start;
        size_t  M;
        size_t  buf;

        buf =   nmemb;
        start = 0;

        while(start<=buf && nmemb > 0){
                M = (nmemb) >> 1;
                if (compare(key, ((char*)base + (start+M)*size)) == -1){
                        nmemb = M;
                }
                else if (compare(key, ((char*)base + (start+M) * size)) == 1){
                        start = start + M + 1;
                        nmemb = nmemb - M - 1;
                }
                else{
                        return (void*)(start + M);
                }
        }
        return (void*)(-1);
}






void main()
{
       
}